package vip.xiaonuo.smzq.modular.dictionary.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import vip.xiaonuo.smzq.modular.dictionary.entity.Cb02Kslx;
import vip.xiaonuo.smzq.modular.dictionary.mapper.Cb02KslxMapper;
import vip.xiaonuo.smzq.modular.dictionary.service.ICb02KslxService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import vip.xiaonuo.common.page.CommonPageRequest;

import javax.annotation.Resource;
import java.util.List;

/**
 * 矿石类型 服务实现类
 *
 * @author eomer
 * @since 2024-02-21
 */
@Service
public class Cb02KslxServiceImpl extends ServiceImpl<Cb02KslxMapper, Cb02Kslx> implements ICb02KslxService {

    @Resource
    private Cb02KslxMapper cb02KslxMapper;

    @Override
    public Page<Cb02Kslx> page(Cb02Kslx cb02Kslx) {
        QueryWrapper<Cb02Kslx> queryWrapper = new QueryWrapper<>();
        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
    }
    /**
     * 矿石类型筛选下拉
     * kcdm 矿产代码
     */
    @Override
    public List<Cb02Kslx> getKslxList(Integer kcdm) {
        QueryWrapper<Cb02Kslx> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("kcdm",kcdm);
        return cb02KslxMapper.selectList(queryWrapper);
    }
}
